package main

import (
	"goserver/db"
	_ "goserver/demo" // 新增导入
	"goserver/routes"
	"log"
	"net/http"
	"time"
)

func main() {
	db := db.InitMongoDB()
	routes.SetupAllRoutes(routes.RouteConfig{
		DB: db,
	})
	server := &http.Server{
		Addr:         ":1111",
		ReadTimeout:  10 * time.Second,
		WriteTimeout: 10 * time.Second,
	}
	log.Printf("服务器启动在 http://localhost%v\n", server.Addr)
	log.Fatal(server.ListenAndServe())

}
